package com.example.demo.Hello;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;



@Controller
public class HelloController {


    @RequestMapping("/test")
    @ResponseBody
    public String test(@RequestParam(name="name",defaultValue = "java") String name){
        return "my Book:"+name;
    }
    @RequestMapping("/book")
    @ResponseBody
    public Book book(){
        Book book=new Book();
        book.setName("八荒破灭");//
        book.setPrice(455);
        return book;
    }
}
